import request from '@/utils/request'

// 查询积分商品分类列表
export function listPointstype(query) {
  return request({
    url: '/business/pointstype/list',
    method: 'get',
    params: query
  })
}

// 查询积分商品分类详细
export function getPointstype(id) {
  return request({
    url: '/business/pointstype/' + id,
    method: 'get'
  })
}

// 新增积分商品分类
export function addPointstype(data) {
  return request({
    url: '/business/pointstype',
    method: 'post',
    data: data
  })
}

// 修改积分商品分类
export function updatePointstype(data) {
  return request({
    url: '/business/pointstype',
    method: 'put',
    data: data
  })
}

// 积分商品分类状态修改
export function changePointstypeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/business/pointstype/changeStatus',
    method: 'put',
    data: data
  })
}

// 删除积分商品分类
export function delPointstype(id) {
  return request({
    url: '/business/pointstype/' + id,
    method: 'delete'
  })
}
